﻿<UserControl x:Class="IPS.TabletPainting.Sequencer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:s="http://schemas.microsoft.com/surface/2008"
             mc:Ignorable="d" 
             Width="150" Height="150">
	<UserControl.Resources>
<!-- Base Grid style for 55 dpi -->
		<Style TargetType="{x:Type Control}" x:Key="ControlBaseStyle">
			<Setter Property="FocusVisualStyle"	
				Value="{x:Null}"/>
			<Setter Property="SnapsToDevicePixels"
				Value="False"/>
			<Setter Property="FontFamily"
				Value="Segoe360"/>
			<Setter Property="FontWeight"
				Value="Normal"/>
			<Setter Property="FontSize"
				Value="17"/>
			<Setter Property="Padding"
				Value="6,2,10,10"/>
			<Setter Property="MinHeight"
				Value="38"/>
			<Setter Property="MinWidth"
				Value="38"/>
			<Setter Property="Margin"
				Value="1"/>
			<Setter Property="HorizontalContentAlignment"
				Value="Left"/>
			<Setter Property="VerticalContentAlignment"
				Value="Top"/>
			<Setter Property="BorderThickness"
				Value="2"/>
		</Style>

<!-- ButtonBase -->
		<Style x:Key="SurfaceButtonStyle1"
			TargetType="{x:Type s:SurfaceButton}" 
			BasedOn="{StaticResource ControlBaseStyle}">
			<Setter Property="IsTabStop"
				Value="False" />
			<Setter Property="Focusable"
				Value="True" />
			<Setter Property="Background"
				Value="{DynamicResource {x:Static s:SurfaceColors.ButtonBackgroundBrushKey}}" />
			<Setter Property="Foreground"
				Value="{DynamicResource {x:Static s:SurfaceColors.ButtonForegroundBrushKey}}" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type s:SurfaceButton}">
						<ControlTemplate.Resources>
							<Storyboard x:Key="Press">
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
									Storyboard.TargetName="PressOverlay"
									Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00.1000000"
										Value="1" />
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
							<Storyboard x:Key="Release">
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
									Storyboard.TargetName="PressOverlay"
									Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00.1500000"
										Value="0" />
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</ControlTemplate.Resources>
						<Grid x:Name="Grid"
							SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
							<Rectangle  x:Name="ButtonBody"
								SnapsToDevicePixels ="{TemplateBinding SnapsToDevicePixels}"/>
							<Rectangle  x:Name="PressOverlay"
								Opacity="0" 							             
								SnapsToDevicePixels ="{TemplateBinding SnapsToDevicePixels}"/>
							<ContentPresenter  x:Name="Content"
								Margin="{TemplateBinding Padding}"  
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"		                                                                           
								VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
								SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
						</Grid>

						<ControlTemplate.Triggers>
							<Trigger Property="IsPressed"
								Value="True">
								<Trigger.EnterActions>
									<BeginStoryboard Storyboard="{StaticResource Press}" />
								</Trigger.EnterActions>
								<Trigger.ExitActions>
									<BeginStoryboard Storyboard="{StaticResource Release}" />
								</Trigger.ExitActions>
								<Setter Property="Foreground"
									Value="{DynamicResource {x:Static s:SurfaceColors.ButtonForegroundPressedBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsEnabled"
								Value="False">
								<Setter Property="Fill"
									Value="{DynamicResource {x:Static s:SurfaceColors.ButtonBackgroundDisabledBrushKey}}"
									TargetName="ButtonBody" />
								<Setter Property="Foreground"
									Value="{DynamicResource {x:Static s:SurfaceColors.ButtonForegroundDisabledBrushKey}}"/>
								<Setter Property="Opacity"
									Value="0.33"
									TargetName="Content" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

	</UserControl.Resources>
    <Grid>
    <Grid>
    <Canvas Name="grid">
        <Ellipse Fill="Gray" Width="150" Height="150"/>
        <Ellipse Fill="{DynamicResource BlueHighlight}" Width="100" Height="100" Canvas.Left="25" Canvas.Top="25"/>
                <s:SurfaceButton Click="SurfaceButton_Click" Canvas.Top="42" Canvas.Left="38" Margin="0" Padding="0" Grid.IsSharedSizeScope="True" Style="{DynamicResource SurfaceButtonStyle1}" Height="66.667" Width="72.333"/>
            </Canvas>
    </Grid>
    <Grid>
            <Ellipse Width="150" Height="150" IsHitTestVisible="False" Visibility="Hidden">
                <Ellipse.Fill>
                    <RadialGradientBrush>
                        <GradientStop Color="#88FFFFFF" Offset="0.807"/>
                        <GradientStop Offset="1"/>
                        <GradientStop Offset="0.622"/>
                    </RadialGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
        </Grid>
    </Grid>
</UserControl>
